<template>
	<view class="admission">
		<view class="admission_content">
			<view class="title">
				{{props.data.name}}
			</view>
			<view class="banner">
				购票须知
			</view>
			<view class="unsubscribe">
				退订条件: 可退
			</view>
		</view>
		<view class="admission_price">
			<view class="price">
				￥<text>{{props.data.price}}</text>
			</view>
			<view class="btn" @click="toTicketing">
				购票
			</view>
		</view>

	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		defineProps,
		defineEmits
	} from 'vue';
	import {
		getMemInfo
	} from "@/api/user.js"

	const props = defineProps({
		data: {
			type: Array,
			default: () => []
		}
	})
	const emits = defineEmits(['openPopup'])

	function toTicketing() {
		getMemInfo().then(e => {
			if (e.data.length > 0) {
				console.log(e.data)
				// emits('openPopup', e.data)11
				emits('openPopup', props.data)
				// uni.navigateTo({
				// 	url: '/pages/login/login'
				// })
			} else {
				uni.navigateTo({
					url: '/pagesD/realNameAuthentication/realNameAuthentication'
				})
			}

		})
	}
</script>

<style lang="less" scoped>
	.admission {
		width: 100%;
		display: flex;

		.admission_content {
			flex: 1;

			.title {
				margin-top: 10rpx;
			}

			.banner {
				border: 2rpx solid orangered;
				color: orangered;
				border-radius: 5rpx;
				padding: 2rpx 4rpx;
				font-size: 20rpx;
				display: inline-block;
				margin-top: 10rpx;
			}

			.unsubscribe {
				color: gray;
				font-size: 20rpx;
				margin-top: 10rpx;
			}
		}

		.admission_price {
			// text-align: right;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: flex-end;

			.price {
				font-size: 20rpx;
				color: orangered;

				text {
					font-size: 36rpx;
					font-weight: 600;
				}
			}

			.btn {
				width: 110rpx;
				border-radius: 60rpx;
				line-height: 55rpx;
				color: #fff;
				text-align: center;
				font-size: 24rpx;
				box-sizing: border-box;
				background: linear-gradient(90deg, orangered, orange);
				margin-top: 10rpx;
			}
		}
	}
</style>